import re
def validator(str):
    while True:
        try:
            str = str.strip()
            if not str:
                raise ValueError("输入不能为空")
            if not re.match(r'^-?\d+(\.\d+)?$', str):
                raise ValueError("输入格式不正确")
            return str
        except ValueError as e:
            str = input(f"{e}，请重新输入: ")
a = input("请输入a:")
a = validator(a)
a = float(a)
b = input("请输入b:")
b = validator(b)
b = float(b)
c = a + b
print(c)